package com.gtenacg.cartoonservice.controller;

import com.gtenacg.cartoonservice.common.Result;
import com.gtenacg.cartoonservice.util.EmailUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class test {

    final EmailUtil emailUtil;

    @PostMapping("/sendMail")
    public Result testSendMail(@RequestParam String toEmail) {
        emailUtil.sendEmail(toEmail, "测试邮件", "测试邮件");
        return Result.success();
    }
}
